package com.toivan.mt.fragment;

import android.os.Bundle;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.shizhefei.fragment.LazyFragment;
import com.toivan.mt.R;
import com.toivan.mt.adapter.MtWatermarkAdapter;
import com.toivan.mt.model.MtWatermark;
import com.toivan.sdk.MtSDK;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MtWatermarkFragment extends LazyFragment {

    private final List<MtWatermark> list = new ArrayList<>();

    private MtWatermarkAdapter adapter;



    @Override
    protected void onCreateViewLazy(Bundle savedInstanceState) {
        super.onCreateViewLazy(savedInstanceState);

        setContentView(R.layout.fragment_sticker_recyclerview);

        list.clear();
        list.addAll(Arrays.asList(MtWatermark.values()));

        RecyclerView watermarkRV = (RecyclerView) findViewById(R.id.recyclerView);
        adapter = new MtWatermarkAdapter(list);
        watermarkRV.setLayoutManager(new GridLayoutManager(getContext(), 5));
        watermarkRV.setAdapter(adapter);
    }

    public void cancelWatermark() {
        if (adapter != null) {
            adapter.cancelSelected();
        }
    }


}


